from flask import Flask,render_template,request
import datetime

app = Flask(__name__)


# @app.route('/')
# def hello_world():  # put application's code here
#     return render_template('index.html')

@app.route('/')
def hello_world2():  # put application's code here
    time = datetime.date.today()
    name = ['小张','小王']
    task = {"任务":"打扫卫生","时间":"3小时"}
    return render_template('index.html',var=time,list=name,task=task)

@app.route('/test/register')
def register():  # put application's code here
    return render_template("test/register.html")
@app.route('/result',methods=['POST','GET'])
def result():  # put application's code here
    if request.method == 'POST':
        result = request.form
        return render_template("test/result.html",result=result)

@app.route('/test/<name>')
def hello_world_test(name):  # put application's code here
    return 'Hello World test1233432!,%s'%name

@app.route('/user/<int:id>')
def hello_world_test2(id):  # put application's code here
    return 'Hello World2 test1233432!,%d'%id


if __name__ == '__main__':
    app.run(debug=True)
